package com.ldd.malphite.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;


//以下两个注解等价于@EnableConfigurationProperties(Car.class)
/*
* 两个作用
*   1、开起配置绑定
*   2、把对象注册到IOC容器中
* */

@Component
@ConfigurationProperties(prefix = "car")
public class Car {

    private String brand;
    private String price;
    private boolean isAuto;
    private String oil;
    private String mirror;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public boolean isAuto() {
        return isAuto;
    }

    public void setAuto(boolean auto) {
        isAuto = auto;
    }

    public String getOil() {
        return oil;
    }

    public void setOil(String oil) {
        this.oil = oil;
    }


    public String getMirror() {
        return mirror;
    }

    public void setMirror(String mirror) {
        this.mirror = mirror;
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                ", price='" + price + '\'' +
                ", isAuto=" + isAuto +
                ", oil='" + oil + '\'' +
                ", mirror='" + mirror + '\'' +
                '}';
    }
}
